# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=cli11
pkgver=2.3.2
pkgrel=1
pkgdesc="Command line parser for C++11"
arch=(any)
url="https://github.com/CLIUtils/CLI11"
license=(BSD)
makedepends=(cmake)
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('aac0ab42108131ac5d3344a9db0fdf25c4db652296641955720a4fbe52334e22')

build() {
  cmake -B build -S ${pkgname^^}-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DCLI11_BUILD_TESTS=OFF \
    -DCLI11_BUILD_EXAMPLES=OFF
  cmake --build build
}

package() {
  DESTDIR="${pkgdir}" cmake --build build --target install
  install -Dm644 ${pkgname^^}-${pkgver}/LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
